//
//  Account.m
//  iWeibo
//
//  Created by dengwei on 15/7/31.
//  Copyright (c) 2015年 dengwei. All rights reserved.
//

#import "Account.h"

@implementation Account

#pragma mark 归档的时候调用
-(void)encodeWithCoder:(NSCoder *)encoder
{

    [encoder encodeObject:_uid forKey:@"uid"];

    [encoder encodeObject:_username forKey:@"username"];
    
    [encoder encodeObject:_authCode forKey:@"authCode"];
    
    [encoder encodeObject:_petName forKey:@"petName"];
    
    [encoder encodeObject:_headImageUrl forKey:@"avatar"];
    
    [encoder encodeObject:_area forKey:@"area"];
    
    [encoder encodeObject:_rolecode forKey:@"rolecode"];
    
    [encoder encodeObject:_invite_uid forKey:@"invite_uid"];

    [encoder encodeObject:_avatar forKey:@"avatar"];
    
    [encoder encodeObject:_executeUid forKey:@"executeUid"];
}

-(id)initWithCoder:(NSCoder *)decoder
{
    if (self = [super init]) {

        self.uid = [decoder decodeObjectForKey:@"uid"];

        self.username = [decoder decodeObjectForKey:@"username"];

        self.authCode = [decoder decodeObjectForKey:@"authCode"];
        
        self.petName = [decoder decodeObjectForKey:@"petName"];
        
        self.headImageUrl = [decoder decodeObjectForKey:@"avatar"];
        
        self.area = [decoder decodeObjectForKey:@"area"];
        
        self.rolecode = [decoder decodeObjectForKey:@"rolecode"];
        
        self.invite_uid = [decoder decodeObjectForKey:@"invite_uid"];
        
        self.avatar = [decoder decodeObjectForKey:@"avatar"];
        
        self.executeUid = [decoder decodeObjectForKey:@"executeUid"];
    }
    
    return self;
}


//- (NSString*)description {
//    
//    return [NSString stringWithFormat:@"accessToken = %@, iconUrl = %@,gender = %@,nickName = %@",self.accessToken, self.iconUrl,self.gender,self.nickName];
//    
//}
@end
